import { Body, Controller, Inject, Post } from '@nestjs/common';
import { PoemTypeService } from './poem-type.service';
import { CreateDto } from './dto/create.dto';
import { DeleteDto } from './dto/delete.dto';
import { UpdateDto } from './dto/update.dto';
import { FindDto } from './dto/find.dto';
import { FindListDto } from './dto/find-list.dto';
// import { Public } from 'src/common/decorators/public.decorator';

@Controller('/poem-type')
export class PoemTypeController {
  @Inject(PoemTypeService)
  private readonly poemTypeService: PoemTypeService;

  @Post('/create')
  create(@Body() body: CreateDto) {
    return this.poemTypeService.create(body);
  }

  @Post('/delete')
  delete(@Body() body: DeleteDto) {
    return this.poemTypeService.delete(body);
  }

  @Post('/update')
  update(@Body() body: UpdateDto) {
    return this.poemTypeService.update(body);
  }

  @Post('/find')
  find(@Body() body: FindDto) {
    return this.poemTypeService.find(body);
  }

  @Post('/list')
  list(@Body() body: FindListDto) {
    return this.poemTypeService.list(body);
  }

  @Post('/scrape')
  scrape() {
    return this.poemTypeService.crawl();
  }
}
